/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package fwdispstartscreen;

import java.lang.reflect.Method;
import java.util.Timer;
import java.util.TimerTask;

/**
 *
 * @author rbs
 */
public class Countdown {
    private int count = 10;

    public Countdown(final StartFrame start, final StartScreenInit init) {
        Timer timer = new Timer();
        TimerTask task = new TimerTask() {
            @Override
            public void run() {
                start.SetCountdown(count);
                //System.out.println(count);
                 if (count == 0)
                {
                    init.continueToMain();
                    this.cancel();
                }
                
                if (count > 0)
                    count--;

               
            }
        };
            timer.schedule(task, 0, 1000);
    }
}
